package com.example.administrator.myservice;

import android.os.Binder;

import java.text.SimpleDateFormat;
import java.util.Date;

public class MyBinder extends Binder {
    /*字符串翻转*/
 public  String reverses(String str1) {
        String[]arr=str1.split(" ");
        StringBuffer buffer=new StringBuffer();
        for (int i=0;i<arr.length;i++) {
                buffer.append(reverse(arr[i])).append(" ");
            }
        return buffer.toString();
    }
    public  String reverse(String str1) {
        char[]charr=str1.toCharArray();
        int len=charr.length;
        for (int i=0;i<len/2;i++){
            char ch=charr[i];
            charr[i]=charr[len-1-i];
            charr[len-1-i]=ch;
        }
        return new String(charr);
    }
/*获取俩数之和*/
    public int add(int a,int b){
        return a+b;
    }
    /*将字符转换成大写*/
    public String toUpperCase(String str){
        return str.toUpperCase();
    }
    /*获取当前时间*/
    public String getTimestr(){
        Date date=new Date();
        SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        return format.format(date);
    }
   
}
